<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdvsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('advs', function (Blueprint $table) {
            $table->increments('id');
            $table->string("title",50)->default('')->comment("广告名称");
            $table->string('type',10)->default('')->comment("类型 banner 轮播图 menu 菜单 advs广告");
            $table->string("image_url",255)->default('')->comment("图片地址");
            $table->tinyInteger("redirect_type")->default(0)->comment('跳转类型 1 app 2 H5');
            $table->string("redirect_name",150)->default('')->comment("跳转名称及地址");
            $table->string("redirect_url",150)->default('')->comment("暂不用");
            $table->string("location",30)->default('')->comment("位置");
            $table->smallInteger("sort")->default(50)->comment("排序");
            $table->integer("app_platform")->default(0)->comment("适用渠道 1android 2ios 3wechat 0不限");
            $table->string("app_version",15)->default('')->comment("版本限制，大于该版本才可显示");
            $table->string("app_name",50)->default('')->comment("APP名称");
            $table->dateTime("start_time")->nullable()->comment("开始显示时间");
            $table->dateTime("end_time")->nullable()->comment("结束显示时间");
            $table->integer("is_show")->default(0)->comment("是否显示");
            $table->integer("is_deleted")->default(0)->comment("是否删除");
            $table->string("note",50)->default('')->comment("备注");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('advs');
    }
}
